// applying a defined LUTs sequence when opening a file.
// suggested by Debora Keller Olivier @olivier_debora

run("Action Bar","/plugins/ActionBar/open_with_lut.ijm");
exit();

<text><html><h2>Drop your image here</h2></html>

<line>
<button>
label=preferences...
arg=<macro>
s=call('ij.Prefs.get','openwithlut.luts',"Cyan,Magenta,Yellow,Grays");
s=getString("LUTs sequence",s);
call('ij.Prefs.set','openwithlut.luts',s);
</macro>
</line>

<DnDAction>
f=getArgument();
open(f);
s=call('ij.Prefs.get','openwithlut.luts',"Cyan,Magenta,Yellow,Grays");
luts=split(s,',');
Stack.getDimensions(width, height, channels, slices, frames);
for(i=1;i<=channels;i++) {
  Stack.setChannel(i);
  run(luts[i-1]);
}
</DnDAction>


